package com.fisionlabs.analizer.chain;

import jpcap.packet.Packet;

import com.fisionlabs.analizer.chain.link.ARPLink;
import com.fisionlabs.analizer.chain.link.ICMPLink;
import com.fisionlabs.analizer.chain.link.IPLink;
import com.fisionlabs.analizer.chain.link.PacketLink;
import com.fisionlabs.analizer.chain.link.TCPLink;
import com.fisionlabs.analizer.chain.link.UDPLink;

public class Chain {
	PacketLink head;
	
	public Chain()
	{
		head = 	new ARPLink().setNext( 
				new ICMPLink().setNext( 
				new TCPLink().setNext(
				new UDPLink().setNext(
				new IPLink() ))));
	}
	
	public boolean search(Packet packet){
		return head.action(packet);
	}
}
